#ifndef _DATALOADER_H
#define _DATALOADER_H
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <tchar.h>
#include "ColoredVertex.h"
#include "TurnsDataModel.h"
#include "World.h"
#include "Land.h"

class DataLoader {

private:
	void loadPredefinedLands(World *);

	bool loadCorner(World *, std::istringstream &);
	bool loadLand(World *, std::istringstream &);
	bool loadObject(World *, std::istringstream &);
	bool loadTile(World *, std::istringstream &);

	bool loadVertex(std::vector<XMFLOAT3> *, std::istringstream &);
	bool loadVertexTextureCoords(std::vector<XMFLOAT2> *, std::istringstream &);
	bool loadTexture(TileObject *, std::istringstream &);
	bool loadFace(std::vector<DWORD> *, std::vector<DWORD> *, std::istringstream &);

public:
	DataLoader();

	World *loadWorld(TCHAR *);

	std::vector<ColoredVertex*> loadColorVertices(World *);
};

#endif
